

function Loong( executor ){
    if( typeof executor === 'function' ) {

        function add( a , b ) {
            return a + b ;
        }

        function sub( a , b ) {
            return a - b ;
        }

        function mult( a , b ) {
            return a * b ;
        }

        function div( a , b ) {
            return a / b ;
        }

        // 通过 call 来调用 executor 函数
        this.result = executor.call( this , add , sub , mult , div );
    }
}

const executor = (add,sub) => {
    // return add( 10 , 15 );
    return sub( 500 , 250 );
}

const x = new Loong( executor );
console.log( x.result );